package art_of_java_concurrent_programming.lock.exclusive;

/**
 * @author lixiangke
 * @date 2018/1/26
 */
public class Counter {
    Mutex lock = new Mutex();
    int count;

    public void increment() {
        lock.lock();
        count++;
        lock.unlock();
    }

    public void print() {
        System.out.println(count);
    }

}
